package com.uum.mq.api.fallback;

import com.uum.mq.api.MqFeignClient;
import com.uum.common.core.result.Result;
import com.uum.common.core.result.ResultCode;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Component
@Slf4j
public class MqFeignFallBackClient implements MqFeignClient {

    @Override
    public Result sendActivateEmail(@RequestParam String email, @RequestParam String username, @RequestParam String token) {
        log.error("feign远程调用消息推送服务-发送激活邮件异常后的降级方法");
        return Result.failed(ResultCode.DEGRADATION);
    }

    @Override
    public Result sendBlog(@RequestParam Long blogId,@RequestParam String title) {
        log.error("feign远程调用消息推送服务-发送博文异常后的降级方法");
        return Result.failed(ResultCode.DEGRADATION);
    }

    @Override
    public Result readAll(@RequestParam Long userId) {
        log.error("feign远程调用消息推送服务-已读所有消息异常后的降级方法");
        return Result.failed(ResultCode.DEGRADATION);
    }

    @Override
    public Result saveReadMsgByUser(Long userId) {
        log.error("feign远程调用（根据用户ID添加所有已读信息）异常后的降级方法");
        return Result.failed(ResultCode.DEGRADATION);
    }

    @Override
    public Result delMsgByUserId(List<String> userId) {
        log.error("feign远程调用（根据用户ID清空消息）异常后的降级方法");
        return Result.failed(ResultCode.DEGRADATION);
    }
}
